using ERPBackend.Models;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace ERPBackend.Services
{
    public interface IInventoryService
    {
        // 获取所有库存
        Task<IEnumerable<Inventory>> GetAllInventoriesAsync();

        // 根据ID获取库存
        Task<Inventory?> GetInventoryByIdAsync(int id);

        // 根据物料ID和仓库ID获取库存
        Task<Inventory?> GetInventoryByMaterialAndWarehouseAsync(int materialId, int warehouseId);

        // 获取分页库存列表
        Task<IEnumerable<Inventory>> GetInventoriesPagedAsync(int page, int pageSize);

        // 获取库存总数
        Task<int> GetTotalInventoriesAsync();

        // 创建库存记录
        Task<Inventory> CreateInventoryAsync(Inventory inventory);

        // 更新库存记录
        Task<bool> UpdateInventoryAsync(Inventory inventory);

        // 删除库存记录
        Task<bool> DeleteInventoryAsync(int id);

        // 更新库存数量
        Task<bool> UpdateInventoryQuantityAsync(int materialId, int warehouseId, decimal quantity, byte transactionType, string remark, int operatorId);

        // 获取库存预警列表
        Task<IEnumerable<Inventory>> GetInventoryAlertsAsync();

        // 获取库存交易记录
        Task<IEnumerable<InventoryTransaction>> GetInventoryTransactionsAsync(int materialId, int warehouseId);
    }
}